Junction boxes usually have a cover and a base which are hinged together. It often happens that the cover is closed over the base but is left unlocked. This may permit access to the interior of the unlocked box by people and animals and/or may permit water, dust, etc. to enter the box, thereby possibly causing damage to the components therein. In addition, such boxes are often made without handles which makes it difficult to pry open the box.
It is therefore desirable to provide an automatic locking mechanism for such boxes which would require a tool to open the box but which would not require a tool to lock the box. The box would automatically lock as soon as the cover is closed. It is also desirable to provide a mechanism which would open the box as soon as the cover is unlocked.